package lab03.test04;

import java.io.*;

/**
 * Created by AIR on 2017/12/28.
 */

public class Test {
    public static void main(String[] args) {
        try {
            FileInputStream reader = new FileInputStream("E:\\hello.txt");
            File file = new File("E:\\test1.txt");
            if (!file.exists()) {
                file.createNewFile();//新建一个需要存储复制内容的文件
            }
            FileOutputStream writer = new FileOutputStream("E:\\test1.txt");
            int i;
            while ((i = reader.read()) != -1) {//读一个字节，写一个字节
                writer.write(i);
            }
            reader.close();
            writer.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


}
